/**
 * 辩论相关接口类型定义
 */

import { BaseApiResponse } from "./interface";

// 辩论基本信息
export interface DebateInfo {
  id: string;
  topicId: string;
  aiChatId?: string;
  roleId: string;
  userId: string;
  status: number; // 状态：0-进行中，1-已完成，2-已评分
  feedback?: string;
  totalScore?: number;
  scoreDetails?: any;
  startTime?: Date;
  endTime?: Date;
  createTime: Date;
  updateTime?: Date;
}

// 辩论话题信息
export interface DebateTopicInfo {
  id: string;
  title: string;
  description?: string;
  category?: string;
  difficulty: number; // 难度等级 1-5
  status: number; // 状态：0-禁用，1-启用
  tags?: string[];
  viewpointA?: string; // 正方观点
  viewpointB?: string; // 反方观点
  backgroundInfo?: string; // 背景信息
  referenceLinks?: string[]; // 参考链接
  createTime: Date;
  updateTime?: Date;
}

// 辩论角色信息
export interface DebateRoleInfo {
  id: string;
  name: string;
  description?: string;
  personality?: string; // 角色性格特点
  expertise?: string[]; // 专业领域
  debateStyle?: string; // 辩论风格
  avatar?: string;
  status: number; // 状态：0-禁用，1-启用
  createTime: Date;
  updateTime?: Date;
}

// 辩论评分详情
export interface DebateScoreDetail {
  id: string;
  debateId: string;
  scoreType: string; // 评分类型：logic-逻辑性，persuasion-说服力，language-语言表达等
  score: number; // 分数 0-100
  maxScore: number; // 满分
  weight: number; // 权重
  feedback?: string; // 评分反馈
  createTime: Date;
}

// 辩论完整信息（包含关联数据）
export interface DebateDetailInfo extends DebateInfo {
  topic?: DebateTopicInfo;
  role?: DebateRoleInfo;
  scoreDetails?: DebateScoreDetail[];
  chatMessages?: {
    id: string;
    role: string; // user, assistant
    content: string;
    timestamp: Date;
  }[];
}

// 辩论列表响应
export interface DebateListResponse {
  debates: DebateInfo[];
  total: number;
  page: number;
  size: number;
}

export interface DebateListApiResponse extends BaseApiResponse<DebateListResponse> {}

// 辩论详情响应
export interface DebateDetailApiResponse extends BaseApiResponse<DebateDetailInfo> {}

// 辩论话题列表响应
export interface DebateTopicListApiResponse extends BaseApiResponse<DebateTopicInfo[]> {}

// 辩论角色列表响应
export interface DebateRoleListApiResponse extends BaseApiResponse<DebateRoleInfo[]> {}

// 创建辩论响应
export interface CreateDebateResponse {
  debateId: string;
  topicId: string;
  roleId: string;
  status: number;
  message?: string;
}

export interface CreateDebateApiResponse extends BaseApiResponse<CreateDebateResponse> {}

// 辩论评分响应
export interface DebateScoreResponse {
  debateId: string;
  totalScore: number;
  scoreDetails: DebateScoreDetail[];
  feedback?: string;
  isCompleted: boolean;
}

export interface DebateScoreApiResponse extends BaseApiResponse<DebateScoreResponse> {}
